package org.jeecg.modules.monitoring.j_monitoring.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;

import java.io.Serializable;

/**
 * @Description: 网关告警历史数据
 * @Author: xiaoyq
 * @Date:   2023-05-09
 * @Version: V1.0
 */
@Data
@TableName("gateway_warning_his")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="网关告警历史数据对象", description="网关告警历史数据")
public class GatewayWarningHis implements Serializable {
    private static final long serialVersionUID = 1L;

	/**id*/
	@TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "id")
    private String id;

	/**st*/
	@Excel(name = "ST值", width = 15)
    @ApiModelProperty(value = "st")
    private String st;
	/**severityClass*/
	@Excel(name = "安全级别", width = 15)
    @ApiModelProperty(value = "severityClass")
    private String severityClass;

    /**category*/
    @Excel(name = "分类", width = 15)
    @ApiModelProperty(value = "category")
    private String category;

	/**additionalInfos*/
	@Excel(name = "附加信息", width = 15)
    @ApiModelProperty(value = "additionalInfos")
    private String additionalInfos;
    /**severity*/
    @Excel(name = "严重等级", width = 15)
    @ApiModelProperty(value = "severity")
    private Integer severity;
	/**severityLabel*/
	@Excel(name = "安全级别文本", width = 15)
    @ApiModelProperty(value = "severityLabel")
    private String severityLabel;
	/**canProcess*/
	@Excel(name = "可否处理", width = 15)
    @ApiModelProperty(value = "canProcess")
    private String canProcess;
	/**additionalText*/
	@Excel(name = "附加文本", width = 15)
    @ApiModelProperty(value = "additionalText")
    private String additionalText;
	/**ip*/
	@Excel(name = "IP", width = 15)
    @ApiModelProperty(value = "ip")
    private String ip;
	/**mtta*/
	@Excel(name = "MTTA", width = 15)
    @ApiModelProperty(value = "mtta")
    private String mtta;
	/**objectClass*/
	@Excel(name = "类名", width = 15)
    @ApiModelProperty(value = "objectClass")
    private String objectClass;
	/**count*/
	@Excel(name = "计数", width = 15)
    @ApiModelProperty(value = "count")
    private Integer count;
	/**updateTimeLabel*/
	@Excel(name = "更新时间", width = 15)
    @ApiModelProperty(value = "updateTimeLabel")
    private String updateTimeLabel;
	/**specificProblems*/
	@Excel(name = "具体问题", width = 15)
    @ApiModelProperty(value = "specificProblems")
    private String specificProblems;
	/**isCurrent*/
	@Excel(name = "是否当前", width = 15)
    @ApiModelProperty(value = "isCurrent")
    private String isCurrent;
	/**isRemoteMO*/
	@Excel(name = "是否远程MO", width = 15)
    @ApiModelProperty(value = "isRemoteMO")
    private String isRemoteMO;
	/**startTimeLabel*/
	@Excel(name = "开始时间", width = 15)
    @ApiModelProperty(value = "startTimeLabel")
    private String startTimeLabel;

	/**objectLabel*/
	@Excel(name = "对象标签", width = 15)
    @ApiModelProperty(value = "objectLabel")
    private String objectLabel;
	/**handlingInfo*/
	@Excel(name = "处理信息", width = 15)
    @ApiModelProperty(value = "handlingInfo")
    private String handlingInfo;
    @Excel(name = "FDN值", width = 15)
    @ApiModelProperty(value = "fdn")
    private String fdn;

    public static GatewayWarningHis from(GatewayWarning warning){
        GatewayWarningHis history = new GatewayWarningHis();

        history.setId(warning.getId());
        history.setSt(warning.getSt());
        history.setSeverityClass(warning.getSeverityClass());
        history.setCategory(warning.getCategory());
        history.setAdditionalInfos(warning.getAdditionalInfos());
        history.setSeverity(warning.getSeverity());
        history.setSeverityLabel(warning.getSeverityLabel());
        history.setCanProcess(warning.getCanProcess());
        history.setAdditionalText(warning.getAdditionalText());
        history.setIp(warning.getIp());
        history.setMtta(warning.getMtta());
        history.setObjectClass(warning.getObjectClass());
        history.setCount(warning.getCount());
        history.setUpdateTimeLabel(warning.getUpdateTimeLabel());
        history.setSpecificProblems(warning.getSpecificProblems());
        history.setIsCurrent(warning.getIsCurrent());
        history.setIsRemoteMO(warning.getIsRemoteMO());
        history.setStartTimeLabel(warning.getStartTimeLabel());
        history.setObjectLabel(warning.getObjectLabel());
        history.setHandlingInfo(warning.getHandlingInfo());
        history.setFdn(warning.getFdn());
        return history;
    }
}
